package br.com.datatraffic.restricao.domain.model;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;

import lombok.Data;
import lombok.EqualsAndHashCode;

@Data @EqualsAndHashCode(exclude = { "equipamentos" }, callSuper = false) @Entity public class UnidadeOperacional {
	@Id @SequenceGenerator(name = "UNIDADEOPERACIONAL_SEQ", sequenceName = "UNIDADEOPERACIONAL_SEQ", allocationSize = 1) @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "UNIDADEOPERACIONAL_SEQ") @Column(name = "UNIDADE_OPERACIONAL_ID", nullable = false) private Long id;
	private String descricao;
	@OneToMany(mappedBy = "unidadeOperacional") private List<Equipamento> equipamentos = new ArrayList<Equipamento>(0);
}
